.class Lcom/netease/newsreader/util/GalleryViewItem$1;
.super Ljava/lang/Object;
.source "GalleryViewItem.java"

# interfaces
.implements Landroid/view/View$OnClickListener;


# annotations
.annotation system Ldalvik/annotation/EnclosingClass;
    value = Lcom/netease/newsreader/util/GalleryViewItem;
.end annotation

.annotation system Ldalvik/annotation/InnerClass;
    accessFlags = 0x0
    name = null
.end annotation


# instance fields
.field final synthetic this$0:Lcom/netease/newsreader/util/GalleryViewItem;


# direct methods
.method constructor <init>(Lcom/netease/newsreader/util/GalleryViewItem;)V
    .locals 0
    .parameter

    .prologue
    .line 1
    iput-object p1, p0, Lcom/netease/newsreader/util/GalleryViewItem$1;->this$0:Lcom/netease/newsreader/util/GalleryViewItem;

    .line 253
    invoke-direct {p0}, Ljava/lang/Object;-><init>()V

    return-void
.end method


# virtual methods
.method public onClick(Landroid/view/View;)V
    .locals 14
    .parameter "v"

    .prologue
    const/4 v5, 0x0

    const/4 v4, 0x0

    .line 258
    iget-object v0, p0, Lcom/netease/newsreader/util/GalleryViewItem$1;->this$0:Lcom/netease/newsreader/util/GalleryViewItem;

    invoke-static {v0}, Lcom/netease/newsreader/util/GalleryViewItem;->access$0(Lcom/netease/newsreader/util/GalleryViewItem;)Landroid/content/Context;

    move-result-object v0

    invoke-virtual {v0}, Landroid/content/Context;->getApplicationContext()Landroid/content/Context;

    move-result-object v8

    check-cast v8, Lcom/netease/newsreader/activity/MyApplication;

    .line 260
    .local v8, app:Lcom/netease/newsreader/activity/MyApplication;
    invoke-virtual {v8}, Lcom/netease/newsreader/activity/MyApplication;->isKeyback()Z

    move-result v0

    if-nez v0, :cond_0

    .line 261
    invoke-virtual {p1, v5}, Landroid/view/View;->setEnabled(Z)V

    .line 262
    iget-object v0, p0, Lcom/netease/newsreader/util/GalleryViewItem$1;->this$0:Lcom/netease/newsreader/util/GalleryViewItem;

    invoke-static {v0}, Lcom/netease/newsreader/util/GalleryViewItem;->access$1(Lcom/netease/newsreader/util/GalleryViewItem;)Landroid/database/sqlite/SQLiteDatabase;

    move-result-object v0

    const-string v1, "vote_table"

    const/4 v2, 0x1

    new-array v2, v2, [Ljava/lang/String;

    const-string v3, "vote_id"

    aput-object v3, v2, v5

    .line 263
    new-instance v3, Ljava/lang/StringBuilder;

    const-string v5, "vote_id="

    invoke-direct {v3, v5}, Ljava/lang/StringBuilder;-><init>(Ljava/lang/String;)V

    iget-object v5, p0, Lcom/netease/newsreader/util/GalleryViewItem$1;->this$0:Lcom/netease/newsreader/util/GalleryViewItem;

    invoke-static {v5}, Lcom/netease/newsreader/util/GalleryViewItem;->access$2(Lcom/netease/newsreader/util/GalleryViewItem;)Ljava/util/Map;

    move-result-object v5

    const-string v6, "vote_id"

    invoke-interface {v5, v6}, Ljava/util/Map;->get(Ljava/lang/Object;)Ljava/lang/Object;

    move-result-object v5

    invoke-virtual {v3, v5}, Ljava/lang/StringBuilder;->append(Ljava/lang/Object;)Ljava/lang/StringBuilder;

    move-result-object v3

    invoke-virtual {v3}, Ljava/lang/StringBuilder;->toString()Ljava/lang/String;

    move-result-object v3

    const-string v7, "auto_id desc"

    move-object v5, v4

    move-object v6, v4

    .line 262
    invoke-virtual/range {v0 .. v7}, Landroid/database/sqlite/SQLiteDatabase;->query(Ljava/lang/String;[Ljava/lang/String;Ljava/lang/String;[Ljava/lang/String;Ljava/lang/String;Ljava/lang/String;Ljava/lang/String;)Landroid/database/Cursor;

    move-result-object v10

    .line 264
    .local v10, cur:Landroid/database/Cursor;
    invoke-interface {v10}, Landroid/database/Cursor;->getCount()I

    move-result v12

    .line 265
    .local v12, num:I
    invoke-interface {v10}, Landroid/database/Cursor;->close()V

    .line 266
    if-lez v12, :cond_1

    .line 270
    iget-object v0, p0, Lcom/netease/newsreader/util/GalleryViewItem$1;->this$0:Lcom/netease/newsreader/util/GalleryViewItem;

    invoke-virtual {v0}, Lcom/netease/newsreader/util/GalleryViewItem;->seeVoteResult()V

    .line 289
    .end local v10           #cur:Landroid/database/Cursor;
    .end local v12           #num:I
    :cond_0
    :goto_0
    return-void

    .line 273
    .restart local v10       #cur:Landroid/database/Cursor;
    .restart local v12       #num:I
    :cond_1
    new-instance v11, Landroid/content/Intent;

    iget-object v0, p0, Lcom/netease/newsreader/util/GalleryViewItem$1;->this$0:Lcom/netease/newsreader/util/GalleryViewItem;

    invoke-static {v0}, Lcom/netease/newsreader/util/GalleryViewItem;->access$0(Lcom/netease/newsreader/util/GalleryViewItem;)Landroid/content/Context;

    move-result-object v0

    const-class v1, Lcom/netease/newsreader/activity/VoteSubmit;

    invoke-direct {v11, v0, v1}, Landroid/content/Intent;-><init>(Landroid/content/Context;Ljava/lang/Class;)V

    .line 274
    .local v11, intent:Landroid/content/Intent;
    const/high16 v0, 0x1000

    invoke-virtual {v11, v0}, Landroid/content/Intent;->addFlags(I)Landroid/content/Intent;

    .line 275
    new-instance v9, Landroid/os/Bundle;

    invoke-direct {v9}, Landroid/os/Bundle;-><init>()V

    .line 276
    .local v9, b:Landroid/os/Bundle;
    new-instance v13, Lcom/netease/newsreader/bean/VoteBean;

    invoke-direct {v13}, Lcom/netease/newsreader/bean/VoteBean;-><init>()V

    .line 278
    .local v13, vb:Lcom/netease/newsreader/bean/VoteBean;
    iget-object v0, p0, Lcom/netease/newsreader/util/GalleryViewItem$1;->this$0:Lcom/netease/newsreader/util/GalleryViewItem;

    invoke-static {v0}, Lcom/netease/newsreader/util/GalleryViewItem;->access$2(Lcom/netease/newsreader/util/GalleryViewItem;)Ljava/util/Map;

    move-result-object v0

    const-string v1, "vote_id"

    invoke-interface {v0, v1}, Ljava/util/Map;->get(Ljava/lang/Object;)Ljava/lang/Object;

    move-result-object v0

    check-cast v0, Ljava/lang/String;

    invoke-virtual {v13, v0}, Lcom/netease/newsreader/bean/VoteBean;->setId(Ljava/lang/String;)V

    .line 279
    iget-object v0, p0, Lcom/netease/newsreader/util/GalleryViewItem$1;->this$0:Lcom/netease/newsreader/util/GalleryViewItem;

    invoke-static {v0}, Lcom/netease/newsreader/util/GalleryViewItem;->access$2(Lcom/netease/newsreader/util/GalleryViewItem;)Ljava/util/Map;

    move-result-object v0

    const-string v1, "voteitem"

    invoke-interface {v0, v1}, Ljava/util/Map;->get(Ljava/lang/Object;)Ljava/lang/Object;

    move-result-object v0

    check-cast v0, Ljava/util/List;

    invoke-virtual {v13, v0}, Lcom/netease/newsreader/bean/VoteBean;->setItemLsit(Ljava/util/List;)V

    .line 280
    iget-object v0, p0, Lcom/netease/newsreader/util/GalleryViewItem$1;->this$0:Lcom/netease/newsreader/util/GalleryViewItem;

    invoke-static {v0}, Lcom/netease/newsreader/util/GalleryViewItem;->access$2(Lcom/netease/newsreader/util/GalleryViewItem;)Ljava/util/Map;

    move-result-object v0

    const-string v1, "question"

    invoke-interface {v0, v1}, Ljava/util/Map;->get(Ljava/lang/Object;)Ljava/lang/Object;

    move-result-object v0

    check-cast v0, Ljava/lang/String;

    invoke-virtual {v13, v0}, Lcom/netease/newsreader/bean/VoteBean;->setItemQuestion(Ljava/lang/String;)V

    .line 282
    const-string v0, "votebean"

    invoke-virtual {v9, v0, v13}, Landroid/os/Bundle;->putSerializable(Ljava/lang/String;Ljava/io/Serializable;)V

    .line 284
    const-string v0, "vb"

    invoke-virtual {v11, v0, v9}, Landroid/content/Intent;->putExtra(Ljava/lang/String;Landroid/os/Bundle;)Landroid/content/Intent;

    .line 285
    iget-object v0, p0, Lcom/netease/newsreader/util/GalleryViewItem$1;->this$0:Lcom/netease/newsreader/util/GalleryViewItem;

    invoke-static {v0}, Lcom/netease/newsreader/util/GalleryViewItem;->access$0(Lcom/netease/newsreader/util/GalleryViewItem;)Landroid/content/Context;

    move-result-object v0

    invoke-virtual {v0, v11}, Landroid/content/Context;->startActivity(Landroid/content/Intent;)V

    goto :goto_0
.end method
